Skip to content

feat(services): replace hardcoded prices with CoinGecko API#487

Merged
Smartdevs17 merged 1 commit into
Smartdevs17:mainfrom
menawar:feat/token-price-fetching
Jun 1, 2026
Merged

feat(services): replace hardcoded prices with CoinGecko API#487
Smartdevs17 merged 1 commit into
Smartdevs17:mainfrom
menawar:feat/token-price-fetching

Conversation

@menawar
Copy link
Copy Markdown

@menawar menawar commented Jun 1, 2026

Adds CoinGecko-backed token price fetching with caching, 60s periodic refresh, pull-to-refresh, and stale-data fallback.

Key changes:

  • fetches real USD prices from CoinGecko
  • seeds from cache, auto-refreshes, and supports manual refresh
  • Wallet connect screens now render live token values instead of hardcoded prices
  • AsyncStorage-backed cache persists price data across restarts

Validation:

  • Targeted tests for priceService and useTokenPrices passed
  • Repo-wide src/store/subscriptionStore.ts(268,6): error TS1005: ',' expected.
    src/store/subscriptionStore.ts(274,12): error TS1005: ';' expected.
    src/store/subscriptionStore.ts(276,22): error TS1005: ';' expected.
    src/store/subscriptionStore.ts(318,25): error TS1005: ';' expected.
    src/store/subscriptionStore.ts(347,25): error TS1005: ';' expected.
    src/store/subscriptionStore.ts(370,31): error TS1005: ';' expected.
    src/store/subscriptionStore.ts(398,27): error TS1005: ';' expected.
    src/store/subscriptionStore.ts(480,25): error TS1005: ';' expected.
    src/store/subscriptionStore.ts(499,21): error TS1005: ';' expected.
    src/store/subscriptionStore.ts(573,5): error TS1109: Expression expected.
    src/store/subscriptionStore.ts(573,6): error TS1128: Declaration or statement expected.
    src/store/subscriptionStore.ts(573,7): error TS1128: Declaration or statement expected.
    src/store/subscriptionStore.ts(576,14): error TS1005: ';' expected.
    src/store/subscriptionStore.ts(577,14): error TS1005: ';' expected.
    src/store/subscriptionStore.ts(578,17): error TS1005: ';' expected.
    src/store/subscriptionStore.ts(579,14): error TS1005: ';' expected.
    src/store/subscriptionStore.ts(580,12): error TS1005: ';' expected.
    src/store/subscriptionStore.ts(584,25): error TS1005: ';' expected.
    src/store/subscriptionStore.ts(614,5): error TS1109: Expression expected.
    src/store/subscriptionStore.ts(615,3): error TS1128: Declaration or statement expected.
    src/store/subscriptionStore.ts(616,1): error TS1128: Declaration or statement expected. is currently blocked by an unrelated pre-existing parse error in
  • Full

subtrackr@1.0.0 test
jest --passWithNoTests is also blocked by the same unrelated store issue in this checkout

Closes #70

Adds priceService.ts which fetches real token USD prices from the
CoinGecko free-tier simple/price endpoint. Implements a 5-minute
in-memory cache (with optional AsyncStorage persistence) to reduce
API calls and provide stale-data fallback when the API is unavailable.

Adds useTokenPrices hook with 60-second periodic refresh, pull-to-
refresh support, and graceful error handling for network failures,
timeouts, and rate limiting.

Removes all hardcoded mock price values from components and screens.

Closes Smartdevs17#70
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

@menawar Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Smartdevs17 Smartdevs17 merged commit c136e3c into Smartdevs17:main Jun 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🔧 Add token price fetching from real API

2 participants